package com.glamour.hlcity.module.dom.analysis.impl;

import org.openide.util.lookup.ServiceProvider;

import com.glamour.hlcity.common.enums.ClassifiedEnum;
import com.glamour.hlcity.common.model.Node;

import com.glamour.hlcity.module.dom.analysis.Classified;

/**
 * 
 * 节点名称相等
 * 
 * @author zhaoxing.liuzx
 * 
 */
@ServiceProvider(service = Classified.class)
public class SimpleClueClassified extends GeneralClueClassified {

	// 保证节点的tag名称的唯一性，暂时将text类节点tag名称定义为hlcity_html_text_tag
	private final static String TAG_NAME_TEXT = "hlcity_html_text_tag";

	@Override
	public ClassifiedEnum getClassifiedEnum() {
		// "仅标签名称相同"
		return ClassifiedEnum.ONLY_SAME_TAG_NAME;
	}

	@Override
	public String classifiedKeyValue(Node node) {
		if (Node.HTML_ELEMENT_TAG.equals(node.getNodeType())) {
			return node.getNodeName();
		} else {
			return TAG_NAME_TEXT;
		}
	}

}
